﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DSLisp.Runtime;
using DSLisp.Infrastructure;

namespace DSLisp.AST
{
    public abstract class ValueNode
    {
        public abstract object Eval(StackFrame stackFrame);

        public abstract object Clone(CloneInfo info);

        public int CodeStartIndex { get; set; }
        public int CodeLength { get; set; }
        public string Code { get; set; }
        public string CodeName { get; set; }
        public bool HideFromCallstack { get; set; }
        public RuntimeStack Stack { get; set; }

        protected void BaseClone(ValueNode clone)
        {
            clone.Code = this.Code;
            clone.CodeStartIndex = this.CodeStartIndex;
            clone.CodeLength = this.CodeLength;
            clone.CodeName = this.CodeName;
            clone.HideFromCallstack = this.HideFromCallstack;
            clone.Stack = this.Stack;
        }
    }
}
